<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/page/common/common_header.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>值别管理</title>

<script src='${baseURL }/js/jquery.min.js'></script>
<script src='${baseURL }/js/common/addTab.js'></script>

<script type="text/javascript" src="http://10.0.250.52/uidev/package/js/itcui.dev.js"></script>
<link rel="stylesheet" type="text/css" href="http://10.0.250.52/uidev/package/css/itcui.dev.css" media="all"/>

<!-- toolbar css  -->
<link rel="stylesheet" type="text/css" href="${baseURL }/css/content_table.css" media="all" />
<link rel="stylesheet" type="text/css" href="${baseURL }/css/itcui.css" media="all" />
<link rel="stylesheet" type="text/css" href="${baseURL }/css/base.css" media="all" />

<script>

	$(document).ready(function() {
		var url = "${baseURL}/duty/getAllDutyList.do";
		
		$("#contentTb").datagrid({
			"loadMsg" : "正在加载，请稍后...",
			"pagination" : true,
			"pageSize":10,
		    "pageList":[5,10,15,20,30],
			"fitColumns" : true,
			"singleSelect":true,
			"url" : url,
			"columns":[[
						{field:'id',title:'ID',align:'center',sortable:true,width : 20 },
						{field:'num',title:'值别编码',align:'center',sortable:true,width : 100},
						{field:'name',title:'值别名称',align:'center',sortable:true,width : 150},
						{field:'sortType',title:'排序',align:'center',sortable:true,width : 100	},
						{field:'deptId',title:'部门',align:'center',sortable:true,width : 100,formatter: 
							function(val,row){
								return val;
							}
						}/* ,{field:'siteId',title:'站点',align:'center',sortable:true,hidden: true	} */
						]],
			"onRenderFinish" : function(){
		        $("#contentTb").ITCUI_Pagination("create","#pager",null);       
		    },"onDblClickRow" : function( rowIndex, rowData ){
		    	var url = "${baseURL}/page/schedule/Duty-updateDuty.jsp?rowData=" + encodeURI( JSON.stringify(rowData) );
		    	
		    	addTab( "dutyListDetail"+rowData.id, "值别详情"+rowData.id, url );
		    }
		});
		
		//高级搜索
		$("#btn_advlocal").click(function() {
			if($(this).hasClass("active")){
				$("#contentTb").ITCUI_GridSearch("end");
			}
			else{
				$("#contentTb").ITCUI_GridSearch("init",{"remoteSearch":true,"onParseArgs":function(arg){
					return {"search":JSON.stringify(arg)};
				}});
			}
		});
		
	});
	
</script>

</head>
<body class="ml12 mr12 mt12">
	<div id="content">
		<div class="toolbar">
		
			<div class="btn-group btn-group-sm" style="float: left;">
				<button type="button" class="btn btn-default" data-toggle="button" id="btn_advlocal">高级搜索</button>
			</div>
			<div class="fr" id="pager" style="width:200px;height:36px;">
			</div>
		</div>
		<div style="clear:both"></div>
		<table id="contentTb"></table>
	</div>
</body>
</html>